<template>
  <section>
    <el-row>
      <el-col :span="12">
        <!-- 报修保养 -->
        <div v-if="typee==0">
          <!-- <el-row>
            <el-col :span="12" class="text_right">名称：</el-col>
            <el-col :span="12">{{repairCommentList.warrantyVo.typeName}}</el-col>
          </el-row> -->
          <el-row>
            <el-col :span="12" class="text_right">报修描述：</el-col>
            <el-col :span="12">{{repairCommentList.warrantyVo.desc}}</el-col>
          </el-row>
          <el-row>
            <el-col :span="12" class="text_right">手机号码：</el-col>
            <el-col :span="12">{{repairCommentList.warrantyVo.phone}}</el-col>
          </el-row>
          <el-row>
            <el-col :span="12" class="text_right">报修地址：</el-col>
            <el-col :span="12">{{repairCommentList.warrantyVo.addressWarranty}}</el-col>
          </el-row>
          <!-- <el-row>
            <el-col :span="12" class="text_right">金额：</el-col>
            <el-col :span="12">{{repairCommentList.warrantyVo.pushCount}}</el-col>
          </el-row> -->
          <el-row>
            <el-col :span="12" class="text_right">报修状态：</el-col>
            <el-col :span="12">{{repairCommentList.warrantyVo.status==1?'待派单':repairCommentList.warrantyVo.status==2?'已派单':repairCommentList.warrantyVo.status==3?'已接单':repairCommentList.warrantyVo.status==4?'已完成':repairCommentList.warrantyVo.status==5?'未通过审核':repairCommentList.warrantyVo.status==6?'已审核':repairCommentList.warrantyVo.status==7?'待回访':repairCommentList.warrantyVo.status==8?'已回访':repairCommentList.warrantyVo.status==9?'已取消':repairCommentList.warrantyVo.status==10?'待关单审核':'已关单'}}</el-col>
          </el-row>
          <!-- <el-row>
            <el-col :span="12" class="text_right">预约时间：</el-col>
            <el-col :span="12">{{$root.getDateArray(repairCommentList.warrantyVo.appointmentTime)[9]}}</el-col>
          </el-row>
          <el-row>
            <el-col :span="12" class="text_right">超时时间：</el-col>
            <el-col :span="12">{{$root.getDateArray(repairCommentList.warrantyVo.chaoTime)[9]}}</el-col>
          </el-row>
          <el-row>
            <el-col :span="12" class="text_right">预超时时间:</el-col>
            <el-col :span="12">{{$root.getDateArray(repairCommentList.warrantyVo.yuTime)[9]}}</el-col>
          </el-row> -->
          <el-row>
            <el-col :span="12" class="text_right">修改时间：</el-col>
            <el-col :span="12">{{$root.getDateArray(repairCommentList.warrantyVo.opertime)[9]}}</el-col>
          </el-row>
          <el-row>
            <el-col :span="12" class="text_right">报修单创建时间：</el-col>
            <el-col :span="12">{{$root.getDateArray(repairCommentList.warrantyVo.createTime)[9]}}</el-col>
          </el-row>
          <!-- <el-row>
            <el-col :span="12" class="text_right">投诉：</el-col>
            <el-col :span="12">{{repairCommentList.warrantyVo.complaint}}</el-col>
          </el-row> -->
          
          <el-row>
            <el-col :span="12" class="text_right">审核人员：</el-col>
            <el-col :span="12">{{repairCommentList.warrantyVo.manager}}</el-col>
          </el-row>
          <!-- <el-row>
            <el-col :span="12" class="text_right">支付状态：</el-col>
            <el-col :span="12">{{repairCommentList.warrantyVo.payStatus==0?'未支付':'已支付'}}</el-col>
          </el-row> -->
          <!-- <el-row>
            <el-col :span="12" class="text_right">回访内容：</el-col>
            <el-col :span="12">{{repairCommentList.warrantyVo.reviewContent}}</el-col>
          </el-row> -->
          <!-- <el-row>
            <el-col :span="12" class="text_right">服务类型：</el-col>
            <el-col :span="12">{{repairCommentList.warrantyVo.typeService==0?'公区报修':'室内报修'}}</el-col>
          </el-row> -->
          <!-- <el-row>
            <el-col :span="12" class="text_right">耗材：</el-col>
            <el-col :span="12" v-if="repairCommentList.warrantyVo.materialVos&&repairCommentList.warrantyVo.materialVos.wuliao">
              <div v-for="iitem in repairCommentList.warrantyVo.materialVos.wuliao" :key="iitem.nameMaterial">{{iitem.nameMaterial}}({{iitem.materialNumber}})</div>
            </el-col>
          </el-row> -->
          <el-row>
            <el-col :span="12" class="text_right">维修实况：</el-col>
            <el-col :span="12" v-if="repairCommentList.warrantyVo.materialVos&&repairCommentList.warrantyVo.materialVos.picture">
              <el-image style="width: 100px; height: 100px" v-for="item in repairCommentList.warrantyVo.materialVos.picture.split('_')" :src="item" fit="cover" v-if="item" :key="item"></el-image>              <!-- {{repairCommentList.warrantyVo.reviewImg}} -->
            </el-col>
          </el-row>
          <!-- <el-row>
            <el-col :span="12" class="text_right">回访图片：</el-col>
            <el-col :span="12" v-if="repairCommentList.warrantyVo.reviewImg">
              <el-image style="width: 100px; height: 100px" v-for="item in repairCommentList.warrantyVo.reviewImg.split('_')" :src="item" fit="cover" v-if="item" :key="item"></el-image>              
            </el-col>
          </el-row> -->
          <el-row>
            <el-col :span="12" class="text_right">图片：</el-col>
            <el-col :span="12" v-if="repairCommentList.warrantyVo.picture">
              <el-image style="width: 100px; height: 100px" v-for="item in repairCommentList.warrantyVo.picture.split('_')" :src="item" fit="cover" v-if="item" :key="item"></el-image>              <!-- {{repairCommentList.warrantyVo.reviewImg}} -->
            </el-col>
          </el-row>
        </div>
      
      </el-col>
      <el-col :span="12" v-if="repairVoos.length!=0">
        <el-timeline>
          <el-timeline-item
            color="#409EFF"
            v-for="(item, index) in repairVoos"
            :key="index"
            placement="top"
            :timestamp="$root.getDateArray(item.processingTime)[9]">
            <div>{{item.status==1?'待派单':item.status==2?'已派单':item.status==3?'已接单':item.status==4?'已完成':item.status==5?'待审核':item.status==6?'已审核':item.status==7?'待回访':item.status==8?'已回访':item.status==9?'已取消':item.status==10?'待关单审核':'已关单'}}</div>
            <div>{{item.content}}</div>
            
          </el-timeline-item>
        </el-timeline>
      </el-col>
    </el-row>

  </section>
</template>

<script>
export default {
  props:['repairCommentList','type'],
  data(){
    return{
      repairVoos:[],
      typee:''
    }
  },
  watch:{
    repairCommentList(val){
      if(val.warrantyVo){//报修
        this.repairVoos = val.warrantyVo.repairVoos
      }else if(val.domesticVo){//事务详情
        this.repairVoos = val.domesticVo.repairVoos
      }else{
        this.repairVoos = val.complaintsVo.repairVoos
      }
    },
    type(val){
      this.typee = val
    }
  },
  mounted(){
    this.$nextTick(()=>{
      if(this.repairCommentList.warrantyVo){//报修
        this.repairVoos = this.repairCommentList.warrantyVo.repairVoos
      }else if(this.repairCommentList.domesticVo){//事务详情
        this.repairVoos = this.repairCommentList.domesticVo.repairVoos
      }else{
        this.repairVoos = this.repairCommentList.complaintsVo.repairVoos
      }
      this.typee = this.type
    })

  }
}
</script>

<style scoped>
.text_right{
  text-align: right;  
}
</style>